"use strict";
cc._RF.push(module, 'c57f9UkIzBLOp/WRN4XA8RO', 'LevelLianXian1');
// scripts/modes/normalMode/levelLianXian/level1/LevelLianXian1.ts

"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
Object.defineProperty(exports, "__esModule", { value: true });
var LevelLianXian_1_1 = require("../base/LevelLianXian_1");
var _a = cc._decorator, ccclass = _a.ccclass, property = _a.property;
var LevelLianXian1 = /** @class */ (function (_super) {
    __extends(LevelLianXian1, _super);
    function LevelLianXian1() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.lbNode = null;
        _this.lbParentNode = null;
        return _this;
    }
    LevelLianXian1.prototype.binGoAni = function (num, str) {
        this.lbParentNode.destroyAllChildren();
        this.lbParentNode.removeAllChildren();
        var length = str.length;
        var isSigle = length % 2 == 0;
        var posXArr = [];
        var zposXArr = [];
        var fposYArr = [];
        for (var i = 0; i < Math.floor(length / 2); i++) {
            var zx = 0;
            var fx = 0;
            if (isSigle) {
                zx = 100 * (i + 1) - 50;
                fx = -(100 * (i + 1) - 50);
            }
            else {
                zx = 100 * (i + 1);
                fx = -(100 * (i + 1));
            }
            zposXArr.push(zx);
            fposYArr.push(fx);
        }
        if (isSigle) {
            posXArr = posXArr.concat(fposYArr.reverse()).concat(zposXArr);
        }
        else {
            posXArr = posXArr.concat(fposYArr.reverse());
            posXArr.push(0);
            posXArr = posXArr.concat(zposXArr);
        }
        for (var i = 0; i < length; i++) {
            var node = cc.instantiate(this.lbNode);
            this.lbParentNode.addChild(node);
            var lb = node.getComponent(cc.Label);
            lb.string = str[i];
            node.setPosition(posXArr[i], 1000);
            cc.tween(node).delay(0.1 * i).to(0.5, { y: 400 }, { easing: cc.easing.backOut }).start();
        }
    };
    __decorate([
        property({ type: cc.Node, displayName: "文本" })
    ], LevelLianXian1.prototype, "lbNode", void 0);
    __decorate([
        property({ type: cc.Node, displayName: "文字父节点" })
    ], LevelLianXian1.prototype, "lbParentNode", void 0);
    LevelLianXian1 = __decorate([
        ccclass
    ], LevelLianXian1);
    return LevelLianXian1;
}(LevelLianXian_1_1.default));
exports.default = LevelLianXian1;

cc._RF.pop();